<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<div>这是一个div</div>

	<script type="text/javascript">
		
		//加载事件 等待页面加载完成后执行
		window.onload = function() {
			var div = document.querySelector('div')
			console.log(div)
		} 

		//获取?后面的数据
		// decodeURI() 将中文乱码转译成中文
	console.log(decodeURI(location.search))
	</script>
</body>
</html>